#ifndef LAYERDOCKWIDGET_H
#define LAYERDOCKWIDGET_H

#include <QTableView>

class QToolButton;
class QStandardItemModel;

class LayerDockWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LayerDockWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
    virtual ~LayerDockWidget();

public:
    void initBottomLayer(const QString& strImageName);

private slots:
    void onDataChanged(QModelIndex tl,QModelIndex br,QVector<int> vec);
    void onClicked(QModelIndex selected);

    void onAddLayer();
    void onDelLayer();
    void onUpLayer();
    void onDownLayer();

private:
    void initWidget();
    void initTableViewAndModel();
    void initToolsButton();
    void connetSignalToSlots();

private:
    QTableView* m_pLayersTableView;
    QStandardItemModel* m_LayersModel;

    QToolButton* m_pAddLayerButton;
    QToolButton* m_pDelLayerButton;
    QToolButton* m_pUpLayerButton;
    QToolButton* m_pDownLayerButton;
};
#endif // LAYERDOCKWIDGET_H
